#region Usings

using System.Web;
using log4net;
using Karma.Framework.Core.IoC;

#endregion

namespace Karma.Framework.Core.Services.Invoker.Handler
{
    public class JsonServiceInvokerHandler : IHttpHandler
    {
        private static ILog LOG = LogManager.GetLogger(typeof (JsonServiceInvokerHandler).Name);

        #region IHttpHandler Members

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";
            if (context.Request.HttpMethod.Equals("POST"))
            {
                var invoker = IoCFactory.Resolve<IInvokerFacade>();
                invoker.Invoke();
            }
        }

        public bool IsReusable
        {
            get { return false; }
        }

        #endregion
    }
}